{include file="layout/layout" /}
<!--账户收入详情表-->
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>账户信息</h3>
            </div>
        </div>
    </div>
    <div class="flexigrid">
        <div class="hDiv">
            <div class="hDivBox ">
                <table cellspacing="0" cellpadding="10">
                    <thead>
                    <tr>
                        <th align="center" abbr="" axis="col5" class="">
                            <div style="text-align: left; width: 100px;" class=""><i class="fa fa-money"> </i> 总收入金额：</div>
                        </th>

                        <th align="center" abbr="" axis="col5" class="">
                            <div style="text-align: left; width: 200px;color:#3b639f;" class="">{$info.agem_brokerage/100}元</div>
                        </th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 100px" class=""><i class="fa fa-envelope"> </i> 账户余额：</div>
                        </th>

                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 200px;color:#3b639f;" class="">{$info.agem_account/100} 元
                                <button style="margin-left:50px;" onclick="withdraw({$info.agem_account},{$info.agem_id},this)">提现</button>
                            </div>
                        </th>
                    </tr>

                    </thead>
                </table>
            </div>
        </div>
    </div>

    <div class="item-title">
        <div class="subject">
            <h3>账户操作记录</h3>
        </div>
        <ul class="tab-base nc-row">
            <li><a href="{:url('Account/account',['inc_type'=> 1])}" ><span>提现记录</span></a></li>
            <li><a href="{:url('Account/account_income',['inc_type'=> 2])}" class="current"><span>收入记录</span></a></li>
        </ul>
    </div>

    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>收入列表</h3>
                <h5>(共{$list|count}条记录)</h5>
            </div>
            <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                    <thead>
                    <tr>
                        <th align="left" abbr="article_title" axis="" class="">
                            <div style="text-align: left; width: 200px;" class="">消费订单</div>
                        </th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 80px;" class="">消费金额(元)</div>
                        </th>

                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width:120px;" class="">消费时间</div>
                        </th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width:120px;" class="">商户</div>
                        </th>

                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width:50px;" class="">状 态</div>
                        </th>

                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: center; width: 80px;">佣金</div>
                        </th>

                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: center; width: 100px;">商户比例(%oo)</div>
                        </th>
                        <th style="width:100%" axis="col7">
                            <div></div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table>
                    <tbody>
                    {foreach name="list" item="vo" key="k" }
                    <tr>
                        <td align="left" class="">
                            <div style="text-align: left; width: 200px;">{$vo.ord_num}</div>
                        </td>
                        <td align="left" class="">
                            <div style="text-align: left; width: 80px;">{$vo.ord_total_price/100}</div>
                        </td>
                        <td align="left" class="">
                            <div style="text-align: left; width: 120px;">{$vo.ord_create_time}</div>
                        </td>
                        <td align="left" class="">
                            <div style="text-align: left; width: 120px;">
                                {$vo.shops.sp_name}
                            </div>
                        </td>
                        <td align="left" class="">
                            <div style="text-align: left; width: 50px;">{$vo.ord_status}</div>
                        </td>
                        <td align="left" class="">
                            <div style="text-align: left; width: 80px;">{$vo.ord_agent_money/100}</div>
                        </td>
                        <td align="left" class="">
                            <div style="text-align: left; width: 100px;">{$vo.ord_agent_ratio}</div>
                        </td>

                        <td align="" class="" style="width: 100%;">
                            <div>&nbsp;</div>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
            <!--分页-->
            {$list->render()|raw}
            <div class="iDiv" style="display: none;"></div>
        </div>
        <!--分页位置-->
    </div>

    <script>
       function withdraw(account,id,obj){
           layer.prompt({title:'请输入提现金额'},function(val, index){
               if(!/(^[1-9](\d+)?(\.\d{1,2})?$)|(^(0){1}$)|(^\d\.\d{1,2}?$)/.test(val)){
                   alert('输入提现金额格式错误，最少1元钱');
                   return false;
               }
               if(val*100 > account){
                   alert('账户余额不足！');
                   return false;
               }
               $.ajax({
                   url:"{:url('account/withdraw')}",
                   data:{'account':val,'id':id},
                   dataType:'json',
                   type:'post',
                   success:function(msg){

                   }
               })
               layer.close(index);
           });
       }
    </script>
</body>
</html>
